<template>
    <div class="el-imlist">
        <div class="el-imlist-back" >
            <span @click="backMenu">
                <img class="el-imlist-backIcon" src="../../../../public/img/arrow.png" alt="">
                返回主页
            </span>
        </div>
        <div class="el-imlist-title">
            <img src="../../../../public/img/materialReceiveMini.png" alt="">
            <span>库存管理</span>
        </div>
        <div class="el-imlist-content">
            <el-menu :default-active=show class="el-menu-vertical-demo">
                <router-link v-for="(item,index) in listName" :key="index" :to='item.url'>
                    <el-menu-item :index=item.index @click="showBj(item.index)">
                    <template slot="title">
                        <span>{{item.name}}</span>
                    </template>
                    </el-menu-item>
                </router-link>
            </el-menu>
        </div>
    </div>
</template>
<script>
export default {
    name:'MdList',
    data(){
        return{
            listName:[
                {
                    index:'1',
                    name:'入库查询',
                    url:'/inventoryManagement/flowQuery'
                },{
                    index:'2',
                    name:'退库查询',
                    url:'/inventoryManagement/stockReturnQuery'
                },{
                    index:'3',
                    name:'库存台账查询',
                    url:'/inventoryManagement/inventoryQuery'
                },{
                    index:'4',
                    name:'交接查询',
                    url:'/inventoryManagement/handoverQuery'
                },{
                    index:'5',
                    name:'托盘信息查询',
                    url:'/inventoryManagement/trayInfo'
                },{
                    index:'6',
                    name:'配送查询',
                    url:'/inventoryManagement/deliveryQuery'
                }],
            show:''
        }
    },
    methods:{
        showBj(index,item){
            this.show = index
            sessionStorage.setItem('listNumber',index)
        },
        backMenu(){
            this.$router.push('/menu')
        }

    },
    mounted(){
        this.show = sessionStorage.getItem('listNumber')
    },
    beforeDestroy(){
        sessionStorage.removeItem('listNumber')
    }
}
</script>
<style scoped>
.el-imlist {
    width: 100%;
    height: 100%;
}
.el-imlist-back {
    width: 80%;
    margin-left: 10%;
    color: #DCEFFB;
    padding-bottom: 15px;
    border-bottom: 1px solid #FFFFFF;
    cursor: pointer;
}
.el-imlist-backIcon {
    height: 14px;
}
.el-imlist-title {
    color: #DCEFFB;
    padding-top: 10px;
    text-align: center;
}
.el-imlist-title span {
    vertical-align: 45%;
}
.el-menu {
    background-color: transparent;
    border: none;
}
.el-imlist-content {
    margin-top: 15px;
    text-align: center;
}
.el-menu-item {
    padding-top: 10px;
    padding-bottom: 10px;
    height: 40px;
    line-height: 20px;
    color: #DCEFFB;
}
.el-menu-item:hover {
    background-color: #2BBECF;
}
.el-menu-item.is-active {
    background-color: #2BBECF;
    color: #FFFFFF;
}
</style>